<html>
<head><meta charset="utf-8"><title>Garbage collecting debug info · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html">Garbage collecting debug info</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="194557289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557289">(Apr 18 2020 at 18:18)</a>:</h4>
<p>Is there anyone informed about rustc's debug info generation who could chime in on an LLVM diff? <a href="https://reviews.llvm.org/D74169#1990625" title="https://reviews.llvm.org/D74169#1990625">https://reviews.llvm.org/D74169#1990625</a></p>
<p>The tl;dr is that Rust currently generates a massive amount of unnecessary debug info (<a href="https://github.com/rust-lang/rust/issues/56068" title="https://github.com/rust-lang/rust/issues/56068">https://github.com/rust-lang/rust/issues/56068</a>) because its codegen units are _huge_. This isn't a problem for the actual text segment because the linker garbage collects unused sections, but no linker presently garbage collects the DWARF associated with those unused sections. The diff linked above adds a <code>--gc-debuginfo</code> flag to lld that seems exactly like what we need, but there is presently a massive link-time penalty. One of the LLVM devs upstream is asking whether there is existing work to optimize this on Rust's end, and I don't know the answer!</p>



<a name="194557413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557413">(Apr 18 2020 at 18:22)</a>:</h4>
<p>No active work from what I know, but maybe <span class="user-mention" data-user-id="119009">@eddyb</span> has something in the pipeline. Seems like that issue went under the radar.</p>



<a name="194557429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557429">(Apr 18 2020 at 18:23)</a>:</h4>
<p>nope but I would love to be able to dedup debuginfo between CGUs</p>



<a name="194557473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557473">(Apr 18 2020 at 18:24)</a>:</h4>
<p>lld growing functionality like this is awesome!</p>



<a name="194557538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557538">(Apr 18 2020 at 18:26)</a>:</h4>
<p>Agreed! Unfortunately it is sloooooooow. The lld patch is still pretty WIP, so unclear if there's just missing optimizations or if there's something fundamentally polynomial about the approach. <code>--gc-sections</code> increased link time from 10s to 240s (!) on the binary I was testing.</p>



<a name="194557645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557645">(Apr 18 2020 at 18:28)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> would you expect to see a decrease in debug info size with <code>codegen-units = 1</code>? That's interesting.</p>



<a name="194557662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557662">(Apr 18 2020 at 18:29)</a>:</h4>
<p>well, it can't be <em>less</em> than that</p>



<a name="194557668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557668">(Apr 18 2020 at 18:29)</a>:</h4>
<p>but I was also thinking cross-crate</p>



<a name="194557713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557713">(Apr 18 2020 at 18:30)</a>:</h4>
<p>which I guess we could measure</p>



<a name="194557731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557731">(Apr 18 2020 at 18:31)</a>:</h4>
<p>you compile all the dependency crates with that flag to only serialize MIR and do no codegen, then compile the final crate with 1 CGU</p>



<a name="194557778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557778">(Apr 18 2020 at 18:32)</a>:</h4>
<p>that should be the minimal size both in terms of LLVM IR and debuginfo (but LLVM passes may increase the total machine code)</p>



<a name="194557863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194557863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194557863">(Apr 18 2020 at 18:34)</a>:</h4>
<p>Is that the <code>-Zmir-only-rlibs</code> flag?</p>



<a name="194558409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194558409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194558409">(Apr 18 2020 at 18:49)</a>:</h4>
<p>Hmm, that flag doesn't seem to exist. Anyway, just compiling everything with <code>codegen-units = 1</code> cut the size of <code>.debug_info</code> by 40% (!). Unfortunately it makes compile times on this project untenable, but still intriguing.</p>



<a name="194562756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194562756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194562756">(Apr 18 2020 at 20:45)</a>:</h4>
<p>right, it removes parallelism</p>



<a name="194562805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194562805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194562805">(Apr 18 2020 at 20:46)</a>:</h4>
<p><span class="user-mention" data-user-id="211702">@Nikhil Benesch</span> hmm, <code>-Z always-encode-mir</code> but what you mention makes more sense</p>



<a name="194562806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194562806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194562806">(Apr 18 2020 at 20:46)</a>:</h4>
<p>I wonder when that went away</p>



<a name="194562948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194562948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194562948">(Apr 18 2020 at 20:50)</a>:</h4>
<p>Yeah, sorry, compile time increase with 1 CGU is totally expected. I'm just musing that even in our CI release pipeline we are unlikely to want to take the 4x increase in compile time for a 40% reduction in debug info.</p>



<a name="194563013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563013">(Apr 18 2020 at 20:50)</a>:</h4>
<p>I would, however, be interested in poking at doing some DWARF deduplication in rustc! But I'd probably need a pointer or two.</p>



<a name="194563015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563015">(Apr 18 2020 at 20:50)</a>:</h4>
<p>you could try to compare it to full LTO</p>



<a name="194563025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563025">(Apr 18 2020 at 20:51)</a>:</h4>
<p><span class="user-mention" data-user-id="211702">@Nikhil Benesch</span> we can't do it in rustc. or rather, this is a linker thing</p>



<a name="194563031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563031">(Apr 18 2020 at 20:51)</a>:</h4>
<p>you'd have to parse DWARF, deduplicate, then re-encode it</p>



<a name="194563084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563084">(Apr 18 2020 at 20:52)</a>:</h4>
<p>(full LTO should have a similar effect to doing codegen only in the final crate)</p>



<a name="194563098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563098">(Apr 18 2020 at 20:52)</a>:</h4>
<p>I'm wondering if rustc could be smarter about creating codegen units, though?</p>



<a name="194563109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563109">(Apr 18 2020 at 20:53)</a>:</h4>
<p>Smarter specifically wrt trying to group bunches of symbols together that can all be dropped on the floor when linking debug info. Maybe that's an impossible ask though.</p>



<a name="194563164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563164">(Apr 18 2020 at 20:54)</a>:</h4>
<p>doesn't sound easy, while what I was thinking is stuff like type descriptions that are replicated across CGUs/libraries</p>



<a name="194563244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563244">(Apr 18 2020 at 20:56)</a>:</h4>
<p>Gotcha. I'll try to get some full LTO stats.</p>



<a name="194563263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563263">(Apr 18 2020 at 20:57)</a>:</h4>
<p>Btw, while I have you, (<del>https://github.com/rust-lang/rust/issues/46034</del> <a href="https://github.com/rust-lang/rust/issues/48762" title="https://github.com/rust-lang/rust/issues/48762">https://github.com/rust-lang/rust/issues/48762</a>) looks pretty easy to address. The tl;dr is that the <code>debug_pubnames</code> and <code>debug_pubtypes</code> sections are pretty useless. Removed in DWARF 5, and no longer generated by default by gcc/clang. There's even a working patch for Rust  that unconditionally omits them.</p>



<a name="194563275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563275">(Apr 18 2020 at 20:57)</a>:</h4>
<p>alright</p>



<a name="194563318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563318">(Apr 18 2020 at 20:58)</a>:</h4>
<p>I think the only hold up is deciding if it's acceptable to change rustc to unconditionally omit those on Linux, or if it needs to be behind some codegen flag that gets stabilized.</p>



<a name="194563326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563326">(Apr 18 2020 at 20:58)</a>:</h4>
<p>Happy to pick that patch up and submit for review if you (or anyone) can advise. I'm not familiar with what sort of stability promises rustc makes on the debug info front.</p>



<a name="194563337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563337">(Apr 18 2020 at 20:58)</a>:</h4>
<p>me neither tbh</p>



<a name="194563346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563346">(Apr 18 2020 at 20:59)</a>:</h4>
<p>Hah, ok! Do you know who would know?</p>



<a name="194563356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563356">(Apr 18 2020 at 20:59)</a>:</h4>
<p>mw is away from Rust for a while</p>



<a name="194563360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563360">(Apr 18 2020 at 20:59)</a>:</h4>
<p>How does it change user-visible behavior?</p>



<a name="194563417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563417">(Apr 18 2020 at 21:00)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> did a bunch of work on debuginfo for the cranelift backend</p>



<a name="194563431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563431">(Apr 18 2020 at 21:00)</a>:</h4>
<p>and <span class="user-mention" data-user-id="124289">@Hanna Kruppe</span>, <span class="user-mention" data-user-id="123586">@nagisa</span> and <span class="user-mention" data-user-id="133224">@Nikita Popov</span> are the go-to people for LLVM things, that I know of</p>



<a name="194563556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563556">(Apr 18 2020 at 21:03)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> AIUI you can tell the linker to build <code>debug_pubnames</code> and <code>debug_pubtypes</code> into a GDB index that speeds up the initial boot of gdb/lldb. But doesn't seem like anyone regularly uses them.</p>



<a name="194563557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563557">(Apr 18 2020 at 21:03)</a>:</h4>
<p>And thanks, eddyb, that's super helpful!</p>



<a name="194563666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563666">(Apr 18 2020 at 21:06)</a>:</h4>
<p>So users would have to customize the linker invocation to benefit from this? Seems fine to remove this then</p>



<a name="194563670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563670">(Apr 18 2020 at 21:06)</a>:</h4>
<p>Here's some additional context on debug_pubnames and debug_pubtypes from Fedora: <a href="https://fedoraproject.org/wiki/Features/GdbIndex#Detailed_Description" title="https://fedoraproject.org/wiki/Features/GdbIndex#Detailed_Description">https://fedoraproject.org/wiki/Features/GdbIndex#Detailed_Description</a></p>
<blockquote>
<p>To the best of my knowledge no program in the distro (and probably no program anywhere) uses these sections. They are just wasted space.</p>
</blockquote>



<a name="194563693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194563693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikhil Benesch <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194563693">(Apr 18 2020 at 21:07)</a>:</h4>
<p>Yeah exactly. In order to make use of it you're already going to need to edit the linker args. Unfortunately there is no LLVM arg that controls their generation, so right now you have no choice but to accept them, and with the existing patch you have no choice but to not have them.</p>



<a name="194571862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194571862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194571862">(Apr 19 2020 at 00:51)</a>:</h4>
<p>Our collector is already fairly good about grouping related stuff together into codegen units, to facilitate incremental compilation. If there’s a possibility to improve it, it would be primarily driven by incremental compilation needs I feel.</p>



<a name="194571915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Garbage%20collecting%20debug%20info/near/194571915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Garbage.20collecting.20debug.20info.html#194571915">(Apr 19 2020 at 00:53)</a>:</h4>
<p>I’d be cool with disabling pubnames/types by default, especially because, I believe, we generate fairly recent version (4) of dwarf in the first place</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>